<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>进入/离开 列表过渡</title>

    <style>
    v-enter-active, v-leave-active {
            transition: opacity .5s;
          }
          v-enter, v-leave-to  {
            opacity: 0;
          }
    </style>

</head>

<body>

    <div id="app">
        <button v-on:click="show = !show">Toggle</button>
        <!-- <transition name="my-transition">，那么 v-enter 会替换为 my-transition-enter。 -->
        <transition>
            <p v-if="show">hello</p>
        </transition>


    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>

    <script>


        new Vue({
            el: '#app',
            data: {
                show: true,
            }
        })
    </script>
</body>

</html>